<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>主页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
    <script type="text/javascript" src="../layui/jquery-3.4.1.min.js"></script>
</head>
<script src="../js/echarts.js"></script>
<script src="../js/echarts.min.js"></script>
<style>
    .layui-layout-admin .layui-logo {
        position: absolute;
        left: 0;
        top: 0;
        width: 25% !important;
        height: 100%;
        line-height: 65px;
        text-align: center;
        font-size: 20px;
    }

    .layui-layout-admin .layui-footer {
        position: fixed;
        left: 0px;
        right: 0;
        bottom: 0;
        height: 30px;
        line-height: 40px;
        padding: 0 10px;
        background-color: #eee;
    }

    .layui-body {
        position: absolute;
        left: 0px;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 998;
        width: auto;
        overflow-y: auto;
        box-sizing: border-box;
    }

    .layui-elem-quote {
        margin-bottom: 10px;
        padding: 10px;
        font-size: 20;
        line-height: 25px;
        border-radius: 0 2px 2px 0;
        background-color: #f2f2f2;
    }

    .table > tbody > tr > td {
        text-align: center;
    }

    .table > thead:first-child > tr:first-child > th {
        text-align: center;
    }
</style>
<style>
    .main_btn > p {
        height: 40px;
    }
</style>
<body class="layui-layout-body">
<div class="layui-body">
    <!-- 内容主体区域 -->
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md3">
                <blockquote class="layui-elem-quote layui-quote-nm" style="padding-left: 35%;">丨长江经济带丨</blockquote>
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div id="main" style="width: 400px;height:220px;"></div>
                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div id="main2" style="width: 400px;height:220px;"></div>
                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div id="main5" style="width: 400px;height:220px;"></div>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div style="width: 1000px;height:500px;">
                    <div class="layui-carousel" id="test10">
                        <div carousel-item="">
                            <div><img src="../images/背景.jpg"></div>
                            <div><img src="../images/轮播2.jpg"></div>
                            <div><img src="../images/轮播3.jpg"></div>
                            <div><img src="../images/轮播4.jpg"></div>
                        </div>
                    </div>
                </div>
                <blockquote class="layui-elem-quote layui-quote-nm" style="padding-left: 50%;">资金投入</blockquote>
                <div class="layui-col-md6">
                    <span style="padding-left: 50%;">长江经济带</span>
                    <table id="example" class="display" style="width:100%">
                        <thead>
                        <tr>
                            <th>行政区</th>
                            <th>总投入（万元）</th>
                            <th>中央资金（万元）</th>
                        </tr>
                        </thead>
                        <tbody style='text-align:center;'>
                        <tr>
                            <td>沈阳市</td>
                            <td>811.3</td>
                            <td>701.3</td>
                        </tr>
                        <tr>
                            <td>大连市</td>
                            <td>689.2</td>
                            <td>502.1</td>
                        </tr>
                        <tr>
                            <td>盘锦市</td>
                            <td>101.1</td>
                            <td>59.3</td>
                        </tr>
                        <tr>
                            <td>阜新市</td>
                            <td>87.6</td>
                            <td>34.8</td>
                        </tr>
                        <tfoot>
                        <tr>
                            <th>合计</th>
                            <th>1689.2</th>
                            <th>1297.5</th>
                        </tr>
                        </tfoot>
                    </table>
                </div>
                <div class="layui-col-md6">
                    <span style="padding-left: 50%;">2018年省级奖补</span>
                    <table id="example2" class="display" style="width:100%">
                        <thead>
                        <tr>
                            <th>行政区</th>
                            <th>总投入（万元）</th>
                            <th>中央资金（万元）</th>
                        </tr>
                        </thead>
                        <tbody style='text-align:center;'>
                        <tr>
                            <td>沈阳市</td>
                            <td>811.3</td>
                            <td>701.3</td>
                        </tr>
                        <tr>
                            <td>大连市</td>
                            <td>689.2</td>
                            <td>502.1</td>
                        </tr>
                        <tr>
                            <td>盘锦市</td>
                            <td>101.1</td>
                            <td>59.3</td>
                        </tr>
                        <tr>
                            <td>阜新市</td>
                            <td>87.6</td>
                            <td>34.8</td>
                        </tr>
                        <tfoot>
                        <tr>
                            <th>合计</th>
                            <th>1689.2</th>
                            <th>1297.5</th>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
            <div class="layui-col-md3">
                <blockquote class="layui-elem-quote layui-quote-nm" style="padding-left: 35%;">丨2018年省级奖补丨</blockquote>
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div id="main3" style="width: 400px;height:220px;"></div>
                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div id="main4" style="width: 400px;height:220px;"></div>
                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div id="main6" style="width: 400px;height:220px;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../layui/layui.all.js"></script>
<script src="../js/core.util.js"></script>

<!-- Echart统计图-->
<script type="text/javascript">
    //***************************************************************************************第1个统计图
    var myChart = echarts.init(document.getElementById('main'));
    option = {
        title: {
            text: '矿山治理统计',
            left: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['未治理', '正在治理', '已完成']
        },
        series: [
            {
                name: '访问来源',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data: [
                    {value: 95, name: '未治理'},
                    {value: 176, name: '正在治理'},
                    {value: 249, name: '已完成'}
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    myChart.setOption(option);

    //************************************************************************************第2个柱状图
    var myChart = echarts.init(document.getElementById('main2'));
    // 指定图表的配置项和数据
    option2 = {
        title: {
            text: '矿山治理面积（亩）',
            left: 'center'
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '10%',
            right: '8%',
            bottom: '8%',
            containLabel: false
        },
        xAxis: [
            {
                type: 'category',
                data: ['沈阳', '大连', '葫芦岛', '抚顺', '锦州', '丹东']
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '复耕',
                type: 'bar',
                stack: '广告',
                data: [120, 132, 101, 134, 90, 230]
            },
            {
                name: '复绿',
                type: 'bar',
                stack: '广告',
                data: [120, 132, 101, 134, 90, 230]
            },
            {
                name: '转建设用地',
                type: 'bar',
                stack: '广告',
                data: [220, 182, 191, 234, 290, 330]
            },
            {
                name: '未治理',
                type: 'bar',
                stack: '广告',
                data: [150, 232, 201, 154, 190, 330]
            }
        ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option2);

    //*********************************************************************************第3个统计图
    var myChart = echarts.init(document.getElementById('main3'));
    option3 = {
        title: {
            text: '矿山治理统计',
            left: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['未治理', '正在治理', '已完成']
        },
        series: [
            {
                name: '访问来源',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data: [
                    {value: 335, name: '未治理'},
                    {value: 310, name: '正在治理'},
                    {value: 234, name: '已完成'}
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    myChart.setOption(option3);
    var myChart = echarts.init(document.getElementById('main4'));

    //***************************************************************************第4个柱状图
    // 指定图表的配置项和数据
    var option4 = {
        title: {
            text: '矿山治理面积（亩）',
            left: 'center'
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '10%',
            right: '8%',
            bottom: '8%',
            containLabel: false
        },
        xAxis: [
            {
                type: 'category',
                data: ['沈阳', '大连', '葫芦岛', '抚顺', '锦州', '丹东']
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '复耕',
                type: 'bar',
                stack: '广告',
                data: [150, 132, 211, 134, 90, 320]
            },
            {
                name: '复绿',
                type: 'bar',
                stack: '广告',
                data: [330, 132, 171, 174, 80, 210]
            },
            {
                name: '转建设用地',
                type: 'bar',
                stack: '广告',
                data: [60, 182, 231, 234, 290, 210]
            },
            {
                name: '未治理',
                type: 'bar',
                stack: '广告',
                data: [220, 232, 181, 154, 190, 350]
            }
        ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option4);
    //***************************************************************************第5个柱状图
    var myChart = echarts.init(document.getElementById('main5'));
    option5 = {
        title: {
            text: '完成治理比例（%）',
            left: 'center'
        },
        xAxis: {
            type: 'category',
            data: ['沈阳', '大连', '葫芦岛', '抚顺', '锦州', '丹东']
        },
        yAxis: {
            type: 'value',
            max: 100
        },
        series: [{
            data: [0, 20, 81, 10, 0, 30, 0],
            type: 'line'
        }]
    };
    myChart.setOption(option5);
    //***************************************************************************第6个柱状图
    var myChart = echarts.init(document.getElementById('main6'));
    option6 = {
        title: {
            text: '完成治理比例（%）',
            left: 'center'
        },
        xAxis: {
            type: 'category',
            data: ['沈阳', '大连', '葫芦岛', '抚顺', '锦州', '丹东']
        },
        yAxis: {
            type: 'value',
            max: 100
        },
        series: [{
            data: [0, 32, 21, 0, 60, 10, 0],
            type: 'line'
        }]
    };
    myChart.setOption(option6);
    layui.use(['carousel', 'form'], function () {
        var carousel = layui.carousel
            , form = layui.form;

        //常规轮播
        carousel.render({
            elem: '#test1'
            , arrow: 'always'
        });

        //改变下时间间隔、动画类型、高度
        carousel.render({
            elem: '#test2'
            , interval: 1800
            , anim: 'fade'
            , height: '120px'
        });

        //设定各种参数
        var ins3 = carousel.render({
            elem: '#test3'
        });
        //图片轮播
        carousel.render({
            elem: '#test10'
            , width: '778px'
            , height: '440px'
            , interval: 5000
        });

        //事件
        carousel.on('change(test4)', function (res) {
            console.log(res)
        });

        var $ = layui.$, active = {
            set: function (othis) {
                var THIS = 'layui-bg-normal'
                    , key = othis.data('key')
                    , options = {};

                othis.css('background-color', '#5FB878').siblings().removeAttr('style');
                options[key] = othis.data('value');
                ins3.reload(options);
            }
        };

        //监听开关
        form.on('switch(autoplay)', function () {
            ins3.reload({
                autoplay: this.checked
            });
        });

        $('.demoSet').on('keyup', function () {
            var value = this.value
                , options = {};
            if (!/^\d+$/.test(value)) return;

            options[this.name] = value;
            ins3.reload(options);
        });

        //其它示例
        $('.demoTest .layui-btn').on('click', function () {
            var othis = $(this), type = othis.data('type');
            active[type] ? active[type].call(this, othis) : '';
        });
    });
</script>
</body>
</html>